<!--
 * @Author: arvin(王德江)
 * @Date: 2022-06-08 16:30:28
 * @LastEditors: arvin(王德江)
 * @LastEditTime: 2022-06-09 11:09:12
 * @Description: 
-->
<template>
  <div>
      <tree-node v-for="{item, index} in data" :key="index" :node="item"></tree-node>
  </div>
</template>

<script>
export default {
    name: 'MyTree',
    components: { 
       TreeNode: {
           props: {
            node: {
               required: true
            }
           },
           mounted() {
               console.log(this.node)
           }
           ,
           render(h) {
              console.log(this.$parent.data)

              this.$nextTick().then(()=> {
                  console.log(this.node)                  
              })
              
              return h('span', this.node)
           }
       }
    },
    props: {
        data: {
            type: Array,
            default: () => {}
        },
    },
    beforeMount() {
        // console.log(this.data)
    },
    methods: {
        clickItem(el) {
            this.$emit('myClick', el)
        }
    }
}
</script>

<style>

</style>